import torch
from TTS.api import TTS
import tempfile
import os
import logging

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

device = "cuda" if torch.cuda.is_available() else "cpu"
logger.info(f"Using device: {device}")

tts = TTS("tts_models/zh-CN/baker/tacotron2-DDC-GST").to(device)
tts.tts_to_file(text="李白是中国唐代著名诗人，以其豪放不羁、浪漫主义的风格著称。",
 file_path="3.wav")


